﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:utils="clr-namespace:Seesmic.Sdp.Utils;assembly=Seesmic.Sdp.Utils"
>
    <DataTemplate x:Key="DefaultFeedItemView">
        <StackPanel Orientation="Vertical">
            <RichTextBox IsReadOnly="True" BorderBrush="Transparent" Background="Transparent" TextWrapping="Wrap">
                <Paragraph>
                    <Hyperlink TextDecorations="None" NavigateUri="{Binding Path=UserUrl}">
                        <Run FontWeight="Bold" Text="{Binding Path=Username}" />
                    </Hyperlink>
                    <Hyperlink TextDecorations="None" NavigateUri="{Binding Path=ContentUrl}">
                        <Run FontStyle="Italic" Text="{Binding Path=Title}" />
                    </Hyperlink>
                    <Span utils:TextRenderer.Source="{Binding Path=Text}">
                        <utils:TextRenderer.TokenDefinitions>
                            <utils:TokenDefinitionCollection>
                                <utils:HrefTokenDefinition />
                                <utils:UrlTokenDefinition />
                            </utils:TokenDefinitionCollection>
                        </utils:TextRenderer.TokenDefinitions>
                    </Span>
                </Paragraph>
            </RichTextBox>
            <!--
            Its unclear how the Metadata control works exactly, but this seems to do the job.
            -->
            <utils:MetadataControl Time="{Binding Path=Time}" IsUniversalTime="True"
                                   IsLinkEnabled="True"
                                   ViaText="{Binding Path=ContentSourceName}"
                                   ViaLinkUri="{Binding Path=ContentSourceUrl}"
                                   SourceLinkContent="{Binding Path=ContentSourceName}"
                                   SourceLinkNavigateUri="{Binding Path=ContentSourceUrl}"
                                   SourceLinkVisibility="Visible"/>
        </StackPanel>
    </DataTemplate>
</ResourceDictionary>